/*******************************************************************************
 * Copyright (c) 2001, 2002 Boris Pruessmann and others.
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Common Public License v0.5
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v05.html
 * 
 * Contributors:
 *    Boris Pruessmann - Initial implementation.
 ******************************************************************************/
package net.sourceforge.perforce.ui;

import net.sourceforge.perforce.ui.views.HistoryView;
import net.sourceforge.perforce.ui.views.PendingChangelistView;
import net.sourceforge.perforce.ui.views.ServerView;
import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

/**
  * Factory for creating Perforce perspectives.
  * 
  * @version $Revision: 169 $
  * @author  <a href="mailto:bpruessmann@users.sourceforge.net">Boris Pruessmann</a>
  */
public class PerforcePerspectiveFactory implements IPerspectiveFactory
{
	// ------------------------------------------------------------------------------ Public Methods
	
	/** @see IPerspectiveFactory#createInitialLayout(IPageLayout) */
	public void createInitialLayout(IPageLayout layout)
	{
		String editorArea = layout.getEditorArea();
		layout.setEditorAreaVisible(true);

		IFolderLayout left = 
			layout.createFolder("left", IPageLayout.LEFT, 0.40f, editorArea);          //$NON-NLS-1$
		left.addView(ServerView.ID);
		left.addView(PendingChangelistView.ID);		
		
		IFolderLayout bottom = 
			layout.createFolder("bottom", IPageLayout.BOTTOM, 0.75f, editorArea);      //$NON-NLS-1$
		bottom.addView(HistoryView.ID);
	}
}
